/**
 * Created by 132 on 2017/11/9.
 */
// let DateUtil = require('./DateUtil')
let statusList = {
  0: '待完善信息',
  1: '待付款',
  2: '设计中',
  3: '设计中',
  4: '设计中',
  5: '设计中',
  6: '设计中',
  7: '设计中',
  8: '设计中',
  9: '设计中',
  10: '3D打印中',
  11: '3D打印中',
  12: '3D打印中',
  13: '3D打印中',
  14: '待收货',
  15: '交易完成',
  16: '交易完成',
  99: '交易关闭',
  30: '设计中',
  31: '订单暂停中',
  32: '已暂停',
  33: '订单取消',
  40: '设计中',
  41: '设计中',
  42: '设计中',
  43: '设计中',
  44: '设计中',
  45: '设计中',
  46: '设计中',
  50: '设计中',
  61: '测量中',
  62: '测量中',
  63: '测量中',
  64: '3D打印中',
  65: '3D打印中',
  66: '3D打印中',
  67: '3D打印中',
  70: '待客服报价',
  97: '退款审核中',
  98: '已退款'
}
let sex = {
  '1': '男',
  '0': '女'
}
let payWay = {
  1: '支付宝',
  2: '微信',
  3: '他人代付',
  5: '线下转账'
  // '': '暂无'

}
// 服务类型
let serviceType = {
  2: '仅分割',
  3: '分割+设计',
  4: '仅设计',
  5: '钛网',
  6: '模型打印+分割',
  7: '模型打印'
}
// 退款阶段
let refundType = {
  1: '申请退款',
  2: '退款审核中',
  3: '已退款'
}
// 认证状态
let authenType = {
  0: '待认证',
  1: '已认证',
  2: '认证失败',
  3: '认证中'
}
// 下单人身份
let placeType = {
  0: '医生',
  1: '代理商',
  2: '医学生'
}
let filters = {
  status (value) {
    let newvalue = statusList[+value]
    return newvalue
  },
  sex (value) {
    let newvalue = sex[+value]
    return newvalue
  },
  payway (value) {
    let newvalue = payWay[+value]
    return newvalue
  },
  serviceType (value) {
    let newvalue = serviceType[+value]
    return newvalue
  },
  refundType (value) {
    let newvalue = refundType[+value]
    return newvalue
  },
  authenType (value) {
    let newvalue = authenType[+value]
    return newvalue
  },
  placetype(value){
    let newvalue = placeType[+value]
    return newvalue
  }
}
export default {
  install () {
    wx.filter = filters
    console.log(wx)
    // for (let i in filters) {
    //   wx.filter(i, filters[i])
    // }
  }
}
